package com.glsc.ngateway.common.base.domainmapper.cmdb;
import com.glsc.ngateway.common.base.domain.mysql.gateway.platform.flow.cmdb.FlowFormPartOut;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.cmdb.domainDto.FlowFormPartOutDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @Author: zhengyr
 * @Desc: domin到dto转换
 */
@Mapper(componentModel = "spring")
public interface FlowFormOuterPartOutMapper {

    FlowFormOuterPartOutMapper INSTANCE = Mappers.getMapper(FlowFormOuterPartOutMapper.class);

    @Mapping(target = "appendicesFileList", ignore = true)
    FlowFormPartOutDto domain2dto(FlowFormPartOut domain);

    List<FlowFormPartOutDto> domain2dto(List<FlowFormPartOut> domain);

    @Mapping(target = "appendicesFileIdList", ignore = true)
    @Mapping(target = "insertTime", ignore = true)
    @Mapping(target = "updateTime", ignore = true)
    @Mapping(target = "deleted", ignore = true)
    FlowFormPartOut dto2domain(FlowFormPartOutDto dto);

    List<FlowFormPartOut> dto2domain(List<FlowFormPartOutDto> dto);
}
